package com.mic.yzzn.plc.core.plcevents;

import java.util.EventObject;

/**
 * 文件改变事件
 */
public class PLCFileChangeEvent extends EventObject
{
	/** 序列化ID */
	private static final long serialVersionUID = -2038630931807304851L;

	/** 文件改变事件类型 */
	public enum PLCFileChangeEventType
	{
		PLCFileChangeEventTypeModified,
		PLCFileChangeEventTypeDelete,
		PLCFileChangeEventTypeCreate
	}
	
	/** 事件类型 */
	private PLCFileChangeEventType type;
	/** 文件名 */
	private String fileName;
	
	// 初始化方法
	private PLCFileChangeEvent(Object source)
	{
		super(source);
	}
	
	public PLCFileChangeEvent(Object source, PLCFileChangeEventType type, String fileName)
	{
		super(source);
		this.type = type;
		this.fileName = fileName;
	}
	
	// Getter
	public String getFileName()
	{
		return fileName;
	}
	
	public PLCFileChangeEventType getType()
	{
		return type;
	}
}
